package cn.highedu.http;

import java.net.ServerSocket;
import java.net.Socket;

public class ServerBootApplication {
    private ServerSocket serverSocket;

    private void start(){
        try {
            serverSocket = new ServerSocket(8089);
            while (true){
                System.out.println("等待连接");
                Socket socket = serverSocket.accept();
                System.out.println("已经连接");
                ClientHandler clientHandler = new ClientHandler(socket);
                Thread thread = new Thread(clientHandler);
                thread.start();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        ServerBootApplication application = new ServerBootApplication();
        application.start();
    }
}
